home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu358.dms / pu358.adf / DonsGenies / Don'sGenies / ILBMsUsingPost.pprx < prev    next >
Text File  |  1992-07-26  |  2KB  |  60 lines

  1. /* This genie uses the public domain Postscript interpreter "Post" to save your as a set of numbered ILBM files in HiRes, 8 colours. You will be asked for the name of the first file (the numbers are added automatically). The files "post" and "init.ps" should be in a drawer called "post" in your "PPage:" drawer (if not, modify the indicated line in the genie), the necessary .psfont files in CGFonts:ps, and "post.library" in libs:  You do NOT need "Conman". 
  2. Make sure the assigns for PPage: and CGFonts: are set up in your startup-sequence or user-startup files. The page size should be set to 6.4 by 5.12 inches for PAL and 6.4 by 4.0 for NTSC. There is a line in the genie source code which has to be modified for NTSC users, to give 640 by 400 pictures. */
  3. /* Note: There is a bug in Post which means that it may refuse to print colour bitmaps on colour printers under WB 2.04. It seems to be OK under WB 1.3.  
  4. Versions of Post older than 1.7 have problems with files from Quark XPress and Freehand.
  5. */
  6.  
  7. trace n
  8.  
  9. signal on error
  10. signal on syntax
  11. address command
  12. call SafeEndEdit.rexx()
  13. call ppm_AutoUpdate(0)
  14. cr="0a"x
  15.  
  16. prompt = "Type file name for pictures..."
  17. basename = ppm_GetFileName(prompt, "PPage:")
  18.  
  19. oldoutput = ppm_GetPSOutput()
  20. oldmode = ppm_GetPSPrintMode()
  21. call ppm_SetPSOutput("ram:temp.ps")
  22. call ppm_SetPSPrintMode(2)
  23. success = ppm_PrintDocPS(1,1)
  24. if success ~=1 then exit_msg("Failed saving temporary Postscript file.")
  25.  
  26.  
  27. /* Set up a text file in ram: and then send it to a temporary command window */
  28. conwindow = "CON:40/40/500/200/NewWindow"
  29. call open out, "ram:temp", write  /* This wipes out any existing ram:temp  */
  30. call writeln out, "cd PPage:Post" /* post is in drawer "Post" in "PPage:" - if not, change this line  */
  31. call writeln out, "post init.ps ram:temp.ps iff "basename"??? size x640y512xd100yd100c3"
  32. call writeln out, "delete ram:temp.ps"
  33. call writeln out, "endcli"
  34. call close out
  35. "newcli" conwindow "ram:temp"
  36.  
  37. call ppm_SetPSOutput(oldoutput)
  38. call ppm_SetPSPrintMode(oldmode)
  39. call exit_msg()
  40.  
  41. end
  42.  
  43. error:
  44. syntax:
  45.     do
  46.     exit_msg("Genie failed due to error: "errortext(rc))
  47.     end
  48.  
  49. exit_msg:
  50.     do
  51.     parse arg message
  52.     if message ~= "" then
  53.     call ppm_Inform(1,message)
  54.     call ppm_ClearStatus()
  55.     call ppm_PPageToFront()
  56.     call ppm_AutoUpdate(1)
  57.     exit
  58.     end
  59.  
  60.